<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>呼叫云</title>
    <link rel="shortcut icon" href="../img/logox_circle.png">
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
    <script src="../js/jquery-1.11.0.min.js"></script> 
    <script src="../js/config.js"></script> 
    <script src="../js/fenye.js"></script> 
	<script>
		$(function(){
			$("#showName").val("tasks1");
			//总条数
			var counts = ${count};
			//总页数
			var pageCouts = "";
			if(counts % 10 == 0){
				pageCouts =  parseInt(counts/10);
			}else{
				pageCouts =  parseInt(counts/10) + 1;
			}
			pg = new showPages('pg','${page}',pageCouts,counts);
			
			pg.printHtml(2,pageCouts);        //显示页数
			
			showPages.prototype.createUrl = function (page) { //生成页面跳转url
				if (isNaN(parseInt(page))) page = 1;
				if (page < 1) page = 1;
				if (page > this.pageCount) page = this.pageCount;
				var url = location.protocol + '//' + location.host + location.pathname +"?page="+page;
				
				//获取参数
				var title = $("#title").val();
				if(title != ""){
					url = url+"&title="+title;
				}
				var entName = $("#entName").val();
				if(entName != ""){
					url = url+"&entName="+entName;
				}
				var callType = $("#callType").val();
				if(callType != ""){
					url = url+"&callType="+callType;
				}
				var runstatus = $("#runstatus").val();
				if(runstatus != ""){
					url = url+"&runstatus="+runstatus;
				}
				var status = $("#status").val();
				if(status != ""){
					url = url+"&status="+status;
				}
				
				return url;
			}
			
		});
		//获取企业任务详情
		function getTask(taskID){
			var url = window.location.search;
			if(url != ""){
				location.href=serviceConfig.task.getTask+"?taskID="+taskID+"&url="+escape(url);
			}else{
				location.href=serviceConfig.task.getTask+"?taskID="+taskID;
			}
		}
	</script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img style="width:100%;" src="../img/logo3.png" alt="呼叫云后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
            	<span id="user_name"></span>
                <a class="button button-little bg-yellow" href="login">注销登录</a>
            </span>
            <#include "../common/head.ftl"> 
        </div>
        <div class="admin-bread">
            <ul class="bread">
                <li><a class="icon-tasks"> 任务管理</a></li>
                <li><a >企业任务</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="admin">
   <div class="line-big">
		<div class="xm12">
			<form action="getTaskList" method="get">
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>任务名称：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="title" name="title" value="${title}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>企业名称：</strong></div>
			<div class="xm1" style="padding:0px;">
				<input type="text" class="input" id="entName" name="entName" value="${entName}"/>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>任务呼叫类型：</strong></div>
			<div class="xm1" style="padding:0px;">
				<select class="input" id="callType" style="width:110%;" name="callType">
					<option value="" >请选择呼叫类型</option>
					<option value="1" <#if callType=='1' > selected </#if>>外呼</option>
					<option value="2" <#if callType=='2' > selected </#if>>综合</option>
				</select>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>进行状态：</strong></div>
			<div class="xm1" style="padding:0px;">
				<select class="input" id="runstatus" style="width:110%;" name="runstatus">
					<option value="" >请选择进行状态</option>
					<option value="0" <#if runstatus=='0' > selected </#if>>未开始</option>
					<option value="1" <#if runstatus=='1' > selected </#if>>已开始</option>
				</select>
			</div>
			<div class="xm1" style="padding:0px;padding-top:10px;text-align:right;"><strong>任务状态：</strong></div>
			<div class="xm1" style="padding:0px;">
				<select class="input" id="status" style="width:110%;" name="status">
					<option value="" >请选择任务状态</option>
					<option value="6" <#if status=='6' > selected </#if>>已保存草稿</option>
					<option value="7" <#if status=='7' > selected </#if>>待审核</option>
					<option value="8" <#if status=='8' > selected </#if>>审核通过未开始</option>
					<option value="9" <#if status=='9' > selected </#if>>审核不通过</option>
					<option value="10" <#if status=='10' > selected </#if>>已开始</option>
					<option value="11" <#if status=='11' > selected </#if>>已结束</option>
				</select>
			</div>
			<div class="xm2" style="padding:0px;text-align:center;">
				<button class="button bg-main" type="submit">搜索</button>
			</div>
		</form>
		</div>
	</div>
    <div class="panel admin-panel" style="margin-top:20px;">
		
    	<div class="panel-head"><strong>企业任务列表</strong></div>
        
        <table class="table table-hover">
        	<tr>
				<th width="40">序号</th>
				<th width="180">任务名称</th>
				<th width="180">任务描述</th>
				<th width="100">发布企业</th>
				<th width="100">企业名称</th>
				<th width="100">企业账户余额</th>
				<th width="80">呼叫类型</th>
				<th width="100">在线时长报酬</th>
				<th width="80">接听报酬</th>
				<th width="80">外呼报酬</th>
				<th width="80">成单报酬</th>
				<th width="80">任务使用金额</th>
				<th width="80">客服数量(已招/需要)</th>
				<th width="80">进行状态</th>
				<th width="80">状态</th>
				<th width="150">创建时间</th>
				<th width="150">修改时间</th>
				<th width="100">操作</th>
			</tr>
			<#list taskList as taskMap>
				<#if count gt 0 >
				<tr>
					<td>${taskMap_index+1}</td>
					    <td>${taskMap.title}</td>
					    <td>${taskMap.desc}</td>
					    <td>${taskMap.loginName}</td>
						<td>${taskMap.entName}</td>
						<td>${taskMap.balance}</td>
						<td>
							<#if taskMap.callType==1 >
								外呼
							<#elseif taskMap.callType==2 >
								综合
							<#else>
								
							</#if>
						</td>
						<td>${taskMap.onlinePay}</td>
						<td>${taskMap.callinPay}</td>
						<td>${taskMap.calloutPay}</td>
						<td>${taskMap.poPay}</td>
						<td>${taskMap.money}</td>
						<td>${taskMap.csHave}/${taskMap.csNeed}</td>
						<td>
							<#if taskMap.runstatus==0 >
								未开始
							<#elseif taskMap.runstatus==1 >
								已开始
							<#else>
								
							</#if>
						</td>
						<td>${taskMap.status}</td>
						<td>${taskMap.createTime}</td>
						<td>${taskMap.updateTime}</td>
						<td>
							<a class="button border-blue button-little" href="#" onclick="getTask('${taskMap.taskID}')">查看</a>
						</td>
				</tr>
				</#if>
			</#list>
			
        </table>
        <div class="panel-foot text-center">
				<#if count gt 0 >
		            <!--<ul class="pagination"><li><a href="#">上一页</a></li></ul>
		            <ul class="pagination pagination-group">
		                <li class="active"><a href="#">1</a></li>
		                <li><a href="#">2</a></li>
		                <li><a href="#">3</a></li>
		                <li><a href="#">4</a></li>
		                <li><a href="#">5</a></li>
		            </ul>
		            <ul class="pagination"><li><a href="#">下一页</a></li></ul>-->
		            
		            
		             <div class="page" id="pages"></div>
		            
		            
		        <#else>
		       <div style="padding-top:30px;"><strong>没有相关数据</strong></div>
				</#if>
        </div>
    </div>
    <br />
</div>

</body>
</html>